<!DOCTYPE html>
<html lang="zh" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="/css/pc-system/iconfont.css">
    <link rel="stylesheet" href="/css/pc-system/common.css">
    <link rel="stylesheet" href="/css/pc-system/login-index.css?v=2019052901">
    <title>登录</title>
</head>
<body ontouchstart>
<div class="login-bk">
    <div class="login-title">
        {{--<img src="/kaohe/pc-img/kpi-1.png">--}}
        <p>青苜网绩效考核系统</p>
    </div>
    <div class="li-list">
        <ul>
            <li>通讯录</li>
            <li>考勤管理</li>
            <li>业绩管理</li>
            <li>同事验证</li>
            <li>数据导出</li>
            <li style="float: right;">企业VIP</li>
        </ul>
    </div>
    <form class="weui-cells login-form" action="" method="post" onsubmit="return false;">
        <h3 class="form-title">用户登录</h3>
        <div class="weui-cell user-cell">
            <div class="weui-cell__hd"><i class="icon iconfont icon-user"></i></div>
            <div class="weui-cell__bd">
                <input type="text" id="username" name="username" class="input-text" placeholder="" />
            </div>
        </div>
        <div class="weui-cell pass-cell">
            <div class="weui-cell__hd"><i class="icon iconfont icon-lock"></i></div>
            <div class="weui-cell__bd">
                <input type="password" id="password" name="password" class="input-text" placeholder="" />
            </div>
        </div>
        <div class="weui-cell hidden-bk">
            <div class="weui-cell__hd"><input type="checkbox" name="remember" class="ace" id="remember"/><span class="lbl"> 记住我</span></div>
            <div class="weui-cell__bd"><a class="find-link" href="/front/find-password">找回密码</a>{{--<a class="register-link" href="/front/register">注册</a>--}}</div>
        </div>
        <button type="submit" class="weui-btn weui-btn_color login-btn"/>登录</button>
        {!! csrf_field() !!}
    </form>
    <div style="text-align: center;">版权所有：南京青苜数据开发有限公司  <a href="https://beian.miit.gov.cn">苏ICP备15006600号-4</a></div>
</div>
{{--<div class="shadow-bk"></div>--}}
<script src="/js/jquery-2.1.4.min.js"></script>
<script src="/addons/layer/layer.js"></script>
<script>
    $(document).ready(function () {
        var token = $('input[name=_token]').val();
        $('.login-btn').click(function () {
            $('.login-btn').attr('disabled','disabled');
            setInterval(function(){
                $('.login-btn').attr('disabled',false);
            },3000);
            var username = $("#username").val().trim();
            var password = $("#password").val().trim();
            var remember = $("#remember").is(":checked");
            if(username==''){
                layer.msg('请输入用户名!', {time: 1000});
                return false;
            }
            if(password == ""){
                layer.msg('请输入密码!', {time: 1000});
                return false;
            }
            $.ajax({
                'url': '/front/login1?_token='+token,
                'type': 'POST',
                'data': 'username='+username+'&password='+password+'&is_remember='+remember,
                'dataType': "json",
                error: function (request) {
                    layer.msg('网络错误!', {time: 1000});
                },
                success: function (data) {
                    if (data.status == 'success') {
                        layer.msg(data.msg, {time: 1000});
                        window.location.href=data.redirectUrl;
                    } else {
                        layer.msg(data.msg, {time: 1000});
                    }
                },
            });
        })
    })
</script>
</body>
</html>
